// const BusinessService = require("../services/businessService")

class screenController {
  // 天气
  async getWeather(req, res) {
    try {
      // 添加2秒延迟
      // await new Promise(resolve => setTimeout(resolve, 2000))
      // const { business_id } = req.query
      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data: [
          {
            statDate: "20241211",
            province: "浙江",
            city: "舟山",
            district: "普陀",
            rtWindPower: "2级",
            rtWindDirection: "北风",
            rtWeather: "阴转多云",
          },
        ],
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  // 假期
  async getHoliday(req, res) {
    try {
      // 添加2秒延迟
      // await new Promise(resolve => setTimeout(resolve, 2000))
      // const { business_id } = req.query
      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data: [
          {
            id: 135,
            statDate: "2024-12-20",
            nextHoliday: "2025年元旦节",
            countdown: 12,
            countdownDesc: "12天",
            isHolidayRange: 0,
            isWeekend: 0,
            dayOfWeek: "星期五",
            dateDesc: null,
            createTime: "2024-10-22T17:18:05Z",
            modifyTime: "2024-11-01T14:12:20Z",
          },
          {
            id: 132,
            statDate: "2024-12-26",
            nextHoliday: "2025年劳动节",
            countdown: 80,
            countdownDesc: "80天",
            isHolidayRange: 0,
            isWeekend: 0,
            dayOfWeek: "星期九",
            dateDesc: null,
            createTime: "2024-10-22T17:18:05Z",
            modifyTime: "2024-11-01T14:12:20Z",
          },
          {
            id: 132,
            statDate: "2024-12-26",
            nextHoliday: "2025年劳动节2",
            countdown: 80,
            countdownDesc: "80天",
            isHolidayRange: 0,
            isWeekend: 0,
            dayOfWeek: "星期九",
            dateDesc: null,
            createTime: "2024-10-22T17:18:05Z",
            modifyTime: "2024-11-01T14:12:20Z",
          },
          {
            id: 132,
            statDate: "2024-12-26",
            nextHoliday: "2025年劳动节3",
            countdown: 80,
            countdownDesc: "80天",
            isHolidayRange: 0,
            isWeekend: 0,
            dayOfWeek: "星期九",
            dateDesc: null,
            createTime: "2024-10-22T17:18:05Z",
            modifyTime: "2024-11-01T14:12:20Z",
          },
        ],
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  // 流量chart
  async getFlowChart(req, res) {
    try {
      // 添加2秒延迟
      // await new Promise(resolve => setTimeout(resolve, 2000))
      const data = [
        {
          kkNum: 2,
          kkTag: "其他",
        },
        {
          kkNum: 2,
          kkTag: "两桥一线",
        },
        {
          kkNum: 2,
          kkTag: "高速收费站",
        },
        {
          kkNum: 2,
          kkTag: "景区",
        },
        {
          kkNum: 2,
          kkTag: "商圈",
        },
        {
          kkNum: 10,
          kkTag: "总计",
        },
      ]
      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  // 流量list
  async getFlowList(req, res) {
    try {
      // 添加2秒延迟
      // await new Promise(resolve => setTimeout(resolve, 2000))
      const data = [
        {
          id: 1,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          lng: 122.4034,
          lat: 29.8062,
          kkTag: "景区",
          kkFlow: 1000,
          flowThreshold: 1500,
          passSpeed: 60.5,
          kkStatus: 0,
          statTime: "2025-03-04 11:28:31",
        },
        {
          id: 2,
          kkCode: "KK002",
          kkName: "朱家尖西大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          lng: 122.4034,
          lat: 29.8062,
          kkTag: "景区",
          kkFlow: 1200,
          flowThreshold: 1500,
          passSpeed: 62.0,
          kkStatus: 0,
          statTime: "2025-03-04 11:28:31",
        },
        {
          id: 3,
          kkCode: "KK003",
          kkName: "舟山西大桥东卡口",
          kkDesc: "舟山西",
          directionType: 1,
          lng: 122.3245,
          lat: 29.9845,
          kkTag: "商圈",
          kkFlow: 850,
          flowThreshold: 1200,
          passSpeed: 55.0,
          kkStatus: 0,
          statTime: "2025-03-04 11:28:31",
        },
        {
          id: 4,
          kkCode: "KK004",
          kkName: "舟山西大桥西卡口",
          kkDesc: "舟山西",
          directionType: 1,
          lng: 122.3245,
          lat: 29.9845,
          kkTag: "商圈",
          kkFlow: 950,
          flowThreshold: 1200,
          passSpeed: 57.0,
          kkStatus: 0,
          statTime: "2025-03-04 11:28:31",
        },
        {
          id: 5,
          kkCode: "KK005",
          kkName: "定海东大桥东卡口",
          kkDesc: "定海东",
          directionType: 1,
          lng: 122.1042,
          lat: 30.0224,
          kkTag: "高速收费站",
          kkFlow: 1200,
          flowThreshold: 1800,
          passSpeed: 65.0,
          kkStatus: 0,
          statTime: "2025-03-04 11:28:31",
        },
        {
          id: 6,
          kkCode: "KK006",
          kkName: "定海东大桥西卡口",
          kkDesc: "定海东",
          directionType: 1,
          lng: 122.1042,
          lat: 30.0224,
          kkTag: "高速收费站",
          kkFlow: 1100,
          flowThreshold: 1800,
          passSpeed: 64.0,
          kkStatus: 0,
          statTime: "2025-03-04 11:28:31",
        },
        {
          id: 7,
          kkCode: "KK007",
          kkName: "沈家门大桥东卡口",
          kkDesc: "沈家门",
          directionType: 1,
          lng: 122.3481,
          lat: 29.9007,
          kkTag: "两桥一线",
          kkFlow: 950,
          flowThreshold: 1300,
          passSpeed: 60.0,
          kkStatus: 0,
          statTime: "2025-03-04 11:28:31",
        },
        {
          id: 8,
          kkCode: "KK008",
          kkName: "沈家门大桥西卡口",
          kkDesc: "沈家门",
          directionType: 1,
          lng: 122.3481,
          lat: 29.9007,
          kkTag: "两桥一线",
          kkFlow: 1050,
          flowThreshold: 1300,
          passSpeed: 61.0,
          kkStatus: 0,
          statTime: "2025-03-04 11:28:31",
        },
        {
          id: 9,
          kkCode: "KK009",
          kkName: "普陀山大桥东卡口",
          kkDesc: "普陀山",
          directionType: 1,
          lng: 122.4278,
          lat: 29.9883,
          kkTag: "其他",
          kkFlow: 700,
          flowThreshold: 1000,
          passSpeed: 58.0,
          kkStatus: 0,
          statTime: "2025-03-04 11:28:31",
        },
        {
          id: 10,
          kkCode: "KK0010",
          kkName: "普陀山大桥西卡口",
          kkDesc: "普陀山",
          directionType: 1,
          lng: 122.4278,
          lat: 29.9883,
          kkTag: "其他",
          kkFlow: 800,
          flowThreshold: 1000,
          passSpeed: 59.0,
          kkStatus: 0,
          statTime: "2025-03-04 11:28:31",
        },
      ]
      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  async getFlowDetail1(req, res) {
    try {
      // 添加2秒延迟
      // await new Promise(resolve => setTimeout(resolve, 2000))
      const data = [
        {
          id: 1,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          lng: 122.4034,
          lat: 29.8062,
          kkTag: "景区",
          kkFlow: 1000,
          flowThreshold: 1500,
          passSpeed: 60.5,
          kkStatus: 0,
          statTime: "2025-03-04 11:28:31",
        },
      ]
      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  async getFlowDetail2(req, res) {
    try {
      // 添加2秒延迟
      // await new Promise(resolve => setTimeout(resolve, 2000))
      const data = [
        {
          id: 1,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2025-03-04 08:00:00",
          flowIndex1: 1500,
          flowIndex2: 1600,
          statTime: "2025-03-04 15:11:15",
        },
      ]
      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  async getFlowDetailChat(req, res) {
    try {
      // 添加2秒延迟
      // await new Promise(resolve => setTimeout(resolve, 2000))
      const data = [
        // flowDataType: 1 实际流量 今年
        {
          id: 11,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2025-03-04 08:00:00",
          flowDataType: 1,
          statDate: "2025-03-04",
          statTime: "00:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 12,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2025-03-04 08:00:00",
          flowDataType: 1,
          statDate: "2025-03-04",
          statTime: "01:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 13,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2025-03-04 08:00:00",
          flowDataType: 1,
          statDate: "2025-03-04",
          statTime: "02:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 14,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2025-03-04 08:00:00",
          flowDataType: 1,
          statDate: "2025-03-04",
          statTime: "03:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 15,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2025-03-04 08:00:00",
          flowDataType: 1,
          statDate: "2025-03-04",
          statTime: "04:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        // flowDataType: 2 预测流量 今年
        {
          id: 11,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2025-03-04 08:00:00",
          flowDataType: 2,
          statDate: "2025-03-04",
          statTime: "00:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 12,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2025-03-04 08:00:00",
          flowDataType: 2,
          statDate: "2025-03-04",
          statTime: "01:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 13,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2025-03-04 08:00:00",
          flowDataType: 2,
          statDate: "2025-03-04",
          statTime: "02:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 14,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2025-03-04 08:00:00",
          flowDataType: 2,
          statDate: "2025-03-04",
          statTime: "03:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 15,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2025-03-04 08:00:00",
          flowDataType: 2,
          statDate: "2025-03-04",
          statTime: "04:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        // flowDataType: 1 实际流量 去年
        {
          id: 11,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2024-03-04 08:00:00",
          flowDataType: 1,
          statDate: "2024-03-04",
          statTime: "00:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 12,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2024-03-04 08:00:00",
          flowDataType: 1,
          statDate: "2024-03-04",
          statTime: "01:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 13,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2024-03-04 08:00:00",
          flowDataType: 1,
          statDate: "2024-03-04",
          statTime: "02:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 14,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2024-03-04 08:00:00",
          flowDataType: 1,
          statDate: "2024-03-04",
          statTime: "03:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 15,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2024-03-04 08:00:00",
          flowDataType: 1,
          statDate: "2024-03-04",
          statTime: "04:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        // flowDataType: 2 预测流量  去年
        {
          id: 11,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2024-03-04 08:00:00",
          flowDataType: 2,
          statDate: "2024-03-04",
          statTime: "00:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 12,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2024-03-04 08:00:00",
          flowDataType: 2,
          statDate: "2024-03-04",
          statTime: "01:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 13,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2024-03-04 08:00:00",
          flowDataType: 2,
          statDate: "2024-03-04",
          statTime: "02:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 14,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2024-03-04 08:00:00",
          flowDataType: 2,
          statDate: "2024-03-04",
          statTime: "03:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
        {
          id: 15,
          kkCode: "KK001",
          kkName: "朱家尖东大桥卡口",
          kkDesc: "朱家尖",
          directionType: 1,
          predictionTime: "2024-03-04 08:00:00",
          flowDataType: 2,
          statDate: "2024-03-04",
          statTime: "04:00:00",
          statFlow: Math.floor(Math.random() * (2000 - 1000 + 1)) + 1000,
        },
      ]
      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }

  // 信控灯 pannel 1
  async getSignPannel1(req, res) {
    try {
      const { tabType } = req.query
      let data = [
        {
          deviceNum: 3,
          deviceStatus: "自动相位",
        },
        {
          deviceNum: 4,
          deviceStatus: "人工相位",
        },
        {
          deviceNum: 3,
          deviceStatus: "设备离线",
        },
        {
          deviceNum: 10,
          deviceStatus: "总计",
        },
      ]

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  // 信控灯 pannel 2
  async getSignPannel2(req, res) {
    try {
      const { tabType } = req.query
      let data = [
        {
          belongRegion: "定海区",
          deviceNum: 2,
        },
        {
          belongRegion: "普陀区",
          deviceNum: 2,
        },
        {
          belongRegion: "岱山县",
          deviceNum: 2,
        },
        {
          belongRegion: "嵊泗县",
          deviceNum: 2,
        },
        {
          belongRegion: "总计",
          deviceNum: 10,
        },
      ]

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  // 信控灯 list
  async getSignList(req, res) {
    try {
      const { tabType } = req.query
      // 生成200条舟山范围内的信控灯数据
      const data = Array.from({ length: 20 }, (_, index) => {
        // 舟山市经纬度范围
        const lng = 121.90 + Math.random() * (123.00 - 121.90) // 经度范围：121.90-123.00
        const lat = 29.80 + Math.random() * (30.20 - 29.80) // 纬度范围：29.80-30.20
        
        // 设备状态随机选择
        const statusList = ["自动相位", "人工相位", "设备离线"]
        const randomStatus = () => statusList[Math.floor(Math.random() * statusList.length)]
        
        // 区域随机选择
        const regionList = ["定海区", "普陀区", "岱山县", "嵊泗县"]
        const randomRegion = regionList[Math.floor(Math.random() * regionList.length)]

        // 生成随机时间
        const getRandomTime = (baseTime) => {
          const time = new Date(baseTime)
          time.setMinutes(time.getMinutes() + Math.floor(Math.random() * 60))
          return time.toISOString().replace('T', ' ').substring(0, 19)
        }

        const baseTime = "2025-03-04 08:00:00"

        return {
          id: index + 1,
          deviceCode: `TL${String(index + 1).padStart(4, '0')}`,
          deviceName: `${randomRegion}信控灯${index + 1}号`,
          lng: Number(lng.toFixed(4)),
          lat: Number(lat.toFixed(4)),
          belongRegion: randomRegion,
          deviceStatus: randomStatus(),
          operator: `操作员${index + 1}`,
          operateTime: getRandomTime(baseTime),
          change1Time: getRandomTime(baseTime),
          change1Status: randomStatus(),
          change2Time: getRandomTime(baseTime),
          change2Status: randomStatus(),
          change3Time: getRandomTime(baseTime),
          change3Status: randomStatus(),
        }
      })

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }

  // 实时视频chart
  async getVideoChart(req, res) {
    try {
      const { tabType } = req.query
      let data
      if (tabType == "1") {
        data = [
          {
            exceptionNum: 122,
            locationType: "总计",
          },
          {
            exceptionNum: 100,
            locationType: "在线数",
          },
          {
            exceptionNum: 100,
            locationType: "离线数",
          },
        ]
      } else {
        data = [
          {
            exceptionNum: 142,
            locationType: "总计",
          },
          {
            exceptionNum: 22,
            locationType: "定海区",
          },
          {
            exceptionNum: 33,
            locationType: "普陀区",
          },
          {
            exceptionNum: 55,
            locationType: "岱山县",
          },
          {
            exceptionNum: 66,
            locationType: "嵊泗县",
          },
        ]
      }

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }

  // 视频pannel 1
  async getVideoPannel1(req, res) {
    try {
      const { tabType } = req.query
      let data = [
        {
          deviceNum: 3,
          deviceStatus: "在线",
        },
        {
          deviceNum: 4,
          deviceStatus: "离线",
        },
        {
          deviceNum: 10,
          deviceStatus: "总计",
        },
      ]

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  // 视频pannel 2
  async getVideoPannel2(req, res) {
    try {
      const { tabType } = req.query
      let data = [
        {
          belongRegion: "定海区",
          deviceNum: 2,
        },
        {
          belongRegion: "普陀区",
          deviceNum: 2,
        },
        {
          belongRegion: "岱山县",
          deviceNum: 2,
        },
        {
          belongRegion: "嵊泗县",
          deviceNum: 2,
        },
        {
          belongRegion: "总计",
          deviceNum: 10,
        },
      ]

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }

  // 视频list
  async getVideoList(req, res) {
    try {
      let data = [
        {
          id: 1,
          deviceCode: "VD001",
          deviceName: "视频设备1",
          lng: 122.2047,
          lat: 30.0161,
          belongRegion: "岱山县",
          deviceStatus: "在线",
        },
        {
          id: 2,
          deviceCode: "VD002",
          deviceName: "视频设备2",
          lng: 122.2222,
          lat: 30.0223,
          belongRegion: "岱山县",
          deviceStatus: "离线",
        },
        {
          id: 3,
          deviceCode: "VD003",
          deviceName: "视频设备3",
          lng: 122.2189,
          lat: 30.0299,
          belongRegion: "岱山县",
          deviceStatus: "在线",
        },
        {
          id: 4,
          deviceCode: "VD004",
          deviceName: "视频设备4",
          lng: 122.2301,
          lat: 30.0354,
          belongRegion: "定海区",
          deviceStatus: "离线",
        },
        {
          id: 5,
          deviceCode: "VD005",
          deviceName: "视频设备5",
          lng: 122.2403,
          lat: 30.0432,
          belongRegion: "定海区",
          deviceStatus: "在线",
        },
        {
          id: 6,
          deviceCode: "VD006",
          deviceName: "视频设备6",
          lng: 122.2504,
          lat: 30.0521,
          belongRegion: "定海区",
          deviceStatus: "离线",
        },
        {
          id: 7,
          deviceCode: "VD007",
          deviceName: "视频设备7",
          lng: 122.2605,
          lat: 30.0605,
          belongRegion: "普陀区",
          deviceStatus: "在线",
        },
        {
          id: 8,
          deviceCode: "VD008",
          deviceName: "视频设备8",
          lng: 122.2706,
          lat: 30.0693,
          belongRegion: "普陀区",
          deviceStatus: "离线",
        },
        {
          id: 9,
          deviceCode: "VD009",
          deviceName: "视频设备9",
          lng: 122.2807,
          lat: 30.0781,
          belongRegion: "普陀区",
          deviceStatus: "在线",
        },
        {
          id: 10,
          deviceCode: "VD010",
          deviceName: "视频设备10",
          lng: 122.2908,
          lat: 30.0869,
          belongRegion: "岱山县",
          deviceStatus: "离线",
        },
      ]

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  // 警力list
  async getPatrolWagonList(req, res) {
    try {
      const { tabType } = req.query
      let data = [
        {
          id: 1,
          resourceId: "RC001",
          resourceName: "警车1",
          resourceType: "警车",
          resourceRegion: "岱山县",
          lng: 122.2047,
          lat: 30.0161,
          policeId: "P001",
          policeName: "张三",
          policePhone: "13712345678",
          policeOrganization: "新城大队",
          checkTime: "2025-03-01 08:00:00",
        },
        {
          id: 2,
          resourceId: "RC002",
          resourceName: "警车2",
          resourceType: "警车",
          resourceRegion: "定海区",
          lng: 122.2222,
          lat: 30.0223,
          policeId: "P002",
          policeName: "李四",
          policePhone: "13723456789",
          policeOrganization: "普陀大队",
          checkTime: "2025-03-01 08:15:00",
        },
        {
          id: 3,
          resourceId: "RC003",
          resourceName: "警车3",
          resourceType: "警车",
          resourceRegion: "定海区",
          lng: 122.2189,
          lat: 30.0299,
          policeId: "P003",
          policeName: "王五",
          policePhone: "13734567890",
          policeOrganization: "定海公安",
          checkTime: "2025-03-01 08:30:00",
        },
        {
          id: 4,
          resourceId: "RC004",
          resourceName: "警车4",
          resourceType: "警车",
          resourceRegion: "嵊泗县",
          lng: 122.2301,
          lat: 30.0354,
          policeId: "P004",
          policeName: "赵六",
          policePhone: "13745678901",
          policeOrganization: "普陀公安",
          checkTime: "2025-03-01 08:45:00",
        },
        {
          id: 5,
          resourceId: "RC005",
          resourceName: "警车5",
          resourceType: "警车",
          resourceRegion: "普陀区",
          lng: 122.2403,
          lat: 30.0432,
          policeId: "P005",
          policeName: "钱七",
          policePhone: "13756789012",
          policeOrganization: "普陀公安",
          checkTime: "2025-03-01 09:00:00",
        },
        {
          id: 6,
          resourceId: "MC001",
          resourceName: "铁骑1",
          resourceType: "铁骑",
          resourceRegion: "岱山县",
          lng: 122.2504,
          lat: 30.0521,
          policeId: "P006",
          policeName: "孙八",
          policePhone: "13767890123",
          policeOrganization: "舟山公安",
          checkTime: "2025-03-01 09:15:00",
        },
      ]

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  // 警情list
  async getDangerThingsList(req, res) {
    try {
      const { tabType } = req.query
      let data = [
        {
          id: 1,
          emergencyNo: "ALM001",
          alarmTime: "2025-03-04 08:15:30",
          emergencySource: "浙里快处",
          belongRegion: "舟山市",
          emergencyType: "交通事故",
          alarmTicketStatus: 1,
          callPersonName: "张三",
          callPersonPhone: "13812345678",
          emergencyDesc: "车辆发生碰撞，交通堵塞",
          dealPoliceId: "P001",
          dealPoliceName: "李四",
          dealPolicePhone: "13987654321",
          acceptOrganization: "舟山公安局",
          lng: 122.2155,
          lat: 30.0345,
          locationDesc: "定海区新华路与东海大道交叉口",
          carType: "警车",
          policeArriveTime: "2025-03-04 08:30:00",
          orderAcceptTime: "2025-03-04 08:20:00",
          orderArriveTime: "2025-03-04 08:45:00",
          feedbackTime: "2025-03-04 09:00:00",
        },
        {
          id: 2,
          emergencyNo: "ALM002",
          alarmTime: "2025-03-04 09:20:50",
          emergencySource: "三台合一",
          belongRegion: "舟山市",
          emergencyType: "盗窃案件",
          alarmTicketStatus: 2,
          callPersonName: "王五",
          callPersonPhone: "13712345678",
          emergencyDesc: "商场内发生盗窃案件",
          dealPoliceId: "P002",
          dealPoliceName: "赵六",
          dealPolicePhone: "13823456789",
          acceptOrganization: "舟山市公安局",
          lng: 122.3198,
          lat: 30.0493,
          locationDesc: "舟山市某商场",
          carType: "铁骑",
          policeArriveTime: "2025-03-04 09:35:00",
          orderAcceptTime: "2025-03-04 09:25:00",
          orderArriveTime: "2025-03-04 09:50:00",
          feedbackTime: "2025-03-04 10:05:00",
        },
        {
          id: 3,
          emergencyNo: "ALM003",
          alarmTime: "2025-03-04 10:45:15",
          emergencySource: "浙里快处",
          belongRegion: "舟山市",
          emergencyType: "交通事故",
          alarmTicketStatus: 1,
          callPersonName: "李七",
          callPersonPhone: "13612345678",
          emergencyDesc: "两车相撞，造成交通拥堵",
          dealPoliceId: "P003",
          dealPoliceName: "钱八",
          dealPolicePhone: "13734567890",
          acceptOrganization: "定海公安分局",
          lng: 122.2381,
          lat: 30.0532,
          locationDesc: "定海区人民路与东海大道交叉口",
          carType: "警车",
          policeArriveTime: "2025-03-04 11:00:00",
          orderAcceptTime: "2025-03-04 10:50:00",
          orderArriveTime: "2025-03-04 11:15:00",
          feedbackTime: "2025-03-04 11:30:00",
        },
        {
          id: 4,
          emergencyNo: "ALM004",
          alarmTime: "2025-03-04 11:30:00",
          emergencySource: "三台合一",
          belongRegion: "舟山市",
          emergencyType: "刑事案件",
          alarmTicketStatus: 1,
          callPersonName: "周九",
          callPersonPhone: "13912345678",
          emergencyDesc: "住宅小区发生盗窃案件",
          dealPoliceId: "P004",
          dealPoliceName: "孙十",
          dealPolicePhone: "13845678901",
          acceptOrganization: "普陀公安分局",
          lng: 122.3078,
          lat: 30.1301,
          locationDesc: "普陀区金塘镇",
          carType: "警务通",
          policeArriveTime: "2025-03-04 11:45:00",
          orderAcceptTime: "2025-03-04 11:40:00",
          orderArriveTime: "2025-03-04 12:00:00",
          feedbackTime: "2025-03-04 12:10:00",
        },
        {
          id: 5,
          emergencyNo: "ALM005",
          alarmTime: "2025-03-04 12:00:30",
          emergencySource: "浙里快处",
          belongRegion: "舟山市",
          emergencyType: "交通事故",
          alarmTicketStatus: 2,
          callPersonName: "刘十",
          callPersonPhone: "13898765432",
          emergencyDesc: "单车翻车，受伤情况严重",
          dealPoliceId: "P005",
          dealPoliceName: "陈十一",
          dealPolicePhone: "13765432109",
          acceptOrganization: "舟山市交通管理局",
          lng: 122.255,
          lat: 30.092,
          locationDesc: "舟山市东海大道与人民路交汇处",
          carType: "警车",
          policeArriveTime: "2025-03-04 12:20:00",
          orderAcceptTime: "2025-03-04 12:10:00",
          orderArriveTime: "2025-03-04 12:30:00",
          feedbackTime: "2025-03-04 12:40:00",
        },
        {
          id: 6,
          emergencyNo: "ALM006",
          alarmTime: "2025-03-04 13:05:20",
          emergencySource: "三台合一",
          belongRegion: "舟山市",
          emergencyType: "盗窃案件",
          alarmTicketStatus: 1,
          callPersonName: "刘一",
          callPersonPhone: "13734567892",
          emergencyDesc: "在公园内发生盗窃案件",
          dealPoliceId: "P006",
          dealPoliceName: "王二",
          dealPolicePhone: "13865432101",
          acceptOrganization: "普陀公安分局",
          lng: 122.3045,
          lat: 30.0956,
          locationDesc: "普陀区梅山公园",
          carType: "铁骑",
          policeArriveTime: "2025-03-04 13:25:00",
          orderAcceptTime: "2025-03-04 13:10:00",
          orderArriveTime: "2025-03-04 13:40:00",
          feedbackTime: "2025-03-04 13:55:00",
        },
      ]

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  // 危险车辆list
  async getDangerCarList(req, res) {
    try {
      const { tabType } = req.query
      let data = [
        {
          id: 1,
          carHphm: "浙A12345",
          hpType: "蓝色",
          riskType: "超速",
          onroadTime: 1.6464e9,
          driverName: "张三",
          driverPhone: "13812345678",
          lng: 122.2121,
          lat: 30.0666,
          carTracking1Time: "2025-03-04 08:10:00",
          carTracking1Name: "定海区东海大道",
          carTracking2Time: "2025-03-04 08:15:00",
          carTracking2Name: "定海区人民路",
        },
        {
          id: 2,
          carHphm: "浙B54321",
          hpType: "黄色",
          riskType: "闯红灯",
          onroadTime: 1.646406e9,
          driverName: "李四",
          driverPhone: "13923456789",
          lng: 122.2154,
          lat: 30.0702,
          carTracking1Time: "2025-03-04 09:00:00",
          carTracking1Name: "舟山市新华路",
          carTracking2Time: "2025-03-04 09:05:00",
          carTracking2Name: "舟山市人民路",
        },
        {
          id: 3,
          carHphm: "浙C67890",
          hpType: "白色",
          riskType: "逆行",
          onroadTime: 1.646412e9,
          driverName: "王五",
          driverPhone: "13734567890",
          lng: 122.2201,
          lat: 30.0733,
          carTracking1Time: "2025-03-04 09:30:00",
          carTracking1Name: "舟山市定海区",
          carTracking2Time: "2025-03-04 09:35:00",
          carTracking2Name: "舟山市东海大道",
        },
        {
          id: 4,
          carHphm: "浙D13579",
          hpType: "绿色",
          riskType: "违停",
          onroadTime: 1.646418e9,
          driverName: "赵六",
          driverPhone: "13698765432",
          lng: 122.2222,
          lat: 30.075,
          carTracking1Time: "2025-03-04 10:00:00",
          carTracking1Name: "舟山市中山路",
          carTracking2Time: "2025-03-04 10:05:00",
          carTracking2Name: "舟山市人民路",
        },
        {
          id: 5,
          carHphm: "浙E24680",
          hpType: "蓝色",
          riskType: "酒驾",
          onroadTime: 1.646424e9,
          driverName: "孙七",
          driverPhone: "13823456789",
          lng: 122.2253,
          lat: 30.0801,
          carTracking1Time: "2025-03-04 10:30:00",
          carTracking1Name: "舟山市西海岸大道",
          carTracking2Time: "2025-03-04 10:35:00",
          carTracking2Name: "舟山市新华路",
        },
        {
          id: 6,
          carHphm: "浙F11111",
          hpType: "黑色",
          riskType: "超速",
          onroadTime: 1.64643e9,
          driverName: "钱八",
          driverPhone: "13987654321",
          lng: 122.2301,
          lat: 30.085,
          carTracking1Time: "2025-03-04 11:00:00",
          carTracking1Name: "舟山市南海大道",
          carTracking2Time: "2025-03-04 11:05:00",
          carTracking2Name: "舟山市东海大道",
        },
        {
          id: 7,
          carHphm: "浙G12121",
          hpType: "红色",
          riskType: "闯红灯",
          onroadTime: 1.646436e9,
          driverName: "吴九",
          driverPhone: "13765432109",
          lng: 122.233,
          lat: 30.09,
          carTracking1Time: "2025-03-04 11:30:00",
          carTracking1Name: "舟山市东海大道",
          carTracking2Time: "2025-03-04 11:35:00",
          carTracking2Name: "舟山市中山路",
        },
      ]

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  // 异常事件list
  async getDangerCaseList(req, res) {
    try {
      const { tabType } = req.query
      let data = [
        {
          id: 1,
          deviceCode: "DEV001",
          deviceName: "设备A",
          findTime: "2025-03-05T10:00:00Z",
          eventType: "高速停驶",
          lng: 122.04,
          lat: 29.985,
          vdoLink: "https://www.example.com/video1.mp4",
          picLink1: "https://www.example.com/pic1.jpg",
          picLink2: "https://www.example.com/pic2.jpg",
          videoLink: "https://www.example.com/device_video1.mp4",
          eventId: "EID001",
        },
        {
          id: 2,
          deviceCode: "DEV002",
          deviceName: "设备B",
          findTime: "2025-03-05T10:30:00Z",
          eventType: "禁行闯入",
          lng: 122.045,
          lat: 29.99,
          vdoLink: "https://www.example.com/video2.mp4",
          picLink1: "https://www.example.com/pic1.jpg",
          picLink2: "https://www.example.com/pic2.jpg",
          videoLink: "https://www.example.com/device_video2.mp4",
          eventId: "EID002",
        },
        {
          id: 3,
          deviceCode: "DEV003",
          deviceName: "设备C",
          findTime: "2025-03-05T11:00:00Z",
          eventType: "高速倒车",
          lng: 122.05,
          lat: 29.995,
          vdoLink: "https://www.example.com/video3.mp4",
          picLink1: "https://www.example.com/pic1.jpg",
          picLink2: "https://www.example.com/pic2.jpg",
          videoLink: "https://www.example.com/device_video3.mp4",
          eventId: "EID003",
        },
        {
          id: 4,
          deviceCode: "DEV004",
          deviceName: "设备D",
          findTime: "2025-03-05T11:30:00Z",
          eventType: "道路施工",
          lng: 122.055,
          lat: 29.99,
          vdoLink: "https://www.example.com/video4.mp4",
          picLink1: "https://www.example.com/pic1.jpg",
          picLink2: "https://www.example.com/pic2.jpg",
          videoLink: "https://www.example.com/device_video4.mp4",
          eventId: "EID004",
        },
        {
          id: 5,
          deviceCode: "DEV005",
          deviceName: "设备E",
          findTime: "2025-03-05T12:00:00Z",
          eventType: "高速停驶",
          lng: 122.06,
          lat: 29.98,
          vdoLink: "https://www.example.com/video5.mp4",
          picLink1: "https://www.example.com/pic1.jpg",
          picLink2: "https://www.example.com/pic2.jpg",
          videoLink: "https://www.example.com/device_video5.mp4",
          eventId: "EID005",
        },
        {
          id: 6,
          deviceCode: "DEV006",
          deviceName: "设备F",
          findTime: "2025-03-05T12:30:00Z",
          eventType: "禁行闯入",
          lng: 122.065,
          lat: 29.975,
          vdoLink: "https://www.example.com/video6.mp4",
          picLink1: "https://www.example.com/pic1.jpg",
          picLink2: "https://www.example.com/pic2.jpg",
          videoLink: "https://www.example.com/device_video6.mp4",
          eventId: "EID006",
        },
        {
          id: 7,
          deviceCode: "DEV007",
          deviceName: "设备G",
          findTime: "2025-03-05T13:00:00Z",
          eventType: "高速倒车",
          lng: 122.07,
          lat: 29.97,
          vdoLink: "https://www.example.com/video7.mp4",
          picLink1: "https://www.example.com/pic1.jpg",
          picLink2: "https://www.example.com/pic2.jpg",
          videoLink: "https://www.example.com/device_video7.mp4",
          eventId: "EID007",
        },
        {
          id: 8,
          deviceCode: "DEV008",
          deviceName: "设备H",
          findTime: "2025-03-05T13:30:00Z",
          eventType: "道路施工",
          lng: 122.075,
          lat: 29.965,
          vdoLink: "https://www.example.com/video8.mp4",
          picLink1: "https://www.example.com/pic1.jpg",
          picLink2: "https://www.example.com/pic2.jpg",
          videoLink: "https://www.example.com/device_video8.mp4",
          eventId: "EID008",
        },
        {
          id: 9,
          deviceCode: "DEV009",
          deviceName: "设备I",
          findTime: "2025-03-05T14:00:00Z",
          eventType: "高速停驶",
          lng: 122.08,
          lat: 29.96,
          vdoLink: "https://www.example.com/video9.mp4",
          picLink1: "https://www.example.com/pic1.jpg",
          picLink2: "https://www.example.com/pic2.jpg",
          videoLink: "https://www.example.com/device_video9.mp4",
          eventId: "EID009",
        },
        {
          id: 10,
          deviceCode: "DEV010",
          deviceName: "设备J",
          findTime: "2025-03-05T14:30:00Z",
          eventType: "禁行闯入",
          lng: 122.085,
          lat: 29.955,
          vdoLink: "https://www.example.com/video10.mp4",
          picLink1: "https://www.example.com/pic1.jpg",
          picLink2: "https://www.example.com/pic2.jpg",
          videoLink: "https://www.example.com/device_video10.mp4",
          eventId: "EID010",
        },
      ]

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }

  // 警力 pannel 1
  async getPatrolWagonPannel1(req, res) {
    try {
      let data = [
        {
          resourceNum: 9,
          resourceType: "对讲机",
        },
        {
          resourceNum: 5,
          resourceType: "警务通",
        },
        {
          resourceNum: 8,
          resourceType: "警车",
        },
        {
          resourceNum: 8,
          resourceType: "铁骑",
        },
        {
          resourceNum: 30,
          resourceType: "总计",
        },
      ]

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  // 警力 pannel 2
  async getPatrolWagonPannel2(req, res) {
    try {
      let data = [
        {
          resourceNum: 11,
          resourceType: "定海区",
        },
        {
          resourceNum: 11,
          resourceType: "普陀区",
        },
        {
          resourceNum: 8,
          resourceType: "岱山县",
        },
        {
          resourceNum: 8,
          resourceType: "嵊泗县",
        },
        {
          resourceNum: 30,
          resourceType: "总计",
        },
      ]

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  // 警情 pannel 1
  async getDangerThingsPannel1(req, res) {
    try {
      let data = [
        {
          emergencyType: "交通事故",
          emergencyNum: 6,
        },
        {
          emergencyType: "刑事案件",
          emergencyNum: 2,
        },
        {
          emergencyType: "盗窃案件",
          emergencyNum: 3,
        },
        {
          emergencyType: "总计",
          emergencyNum: 11,
        },
      ]

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  // 警情 pannel 2
  async getDangerThingsPannel2(req, res) {
    try {
      let data = [
        {
          emergencyType: "定海区",
          emergencyNum: 12,
        },
        {
          emergencyType: "普陀区",
          emergencyNum: 13,
        },
        {
          emergencyType: "岱山县",
          emergencyNum: 16,
        },
        {
          emergencyType: "嵊泗县",
          emergencyNum: 31,
        },
        {
          emergencyType: "总计",
          emergencyNum: 44,
        },
      ]

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
  // 异常事件 pannel
  async DangerCasePannel(req, res) {
    try {
      let data = [
        {
          eventType: "禁行闯入",
          eventNum: 8,
        },
        {
          eventType: "道路施工",
          eventNum: 7,
        },
        {
          eventType: "高速倒车",
          eventNum: 7,
        },
        {
          eventType: "高速停驶",
          eventNum: 8,
        },
        {
          eventType: "总计",
          eventNum: 30,
        },
      ]

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }

  // 危险车辆pannel
  async getDangerCarPannel(req, res) {
    try {
      const { tabType } = req.query
      let data = []

      res.json({
        code: 200,
        message: "请求成功返回数据",
        timestamp: 1734674474734,
        data,
      })
    } catch (error) {
      res.status(500).json({
        code: 500,
        msg: error.message,
      })
    }
  }
}

module.exports = new screenController()
